package com.grapecc.springcloud.controller;

import com.grapecc.springcloud.entities.CommonResult;
import com.grapecc.springcloud.entities.Payment;
import com.grapecc.springcloud.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 卖糖的兜兜
 * @version 1.0.0
 * @ClassName OrderFeignController.java
 * @Description TODO
 * @createTime 2022年02月10日 16:07:00
 */
@RestController
@Slf4j
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping("/consumer/payment/feign/get/{id}")
   public CommonResult<Payment> getPayment(@PathVariable("id") Long id){
        CommonResult<Payment> payment = paymentFeignService.getPayment(id);
        return payment;
    }

    @RequestMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeout(){
        String s = paymentFeignService.paymentFeignTimeout();
        return s;
    }
}
